<?php $this->load->view('partials/breadcrumb.tpl', Array('_BTN_GROUP' => array('url' => site_url($thisModule . $thisController), 'class' => 'btn default', 'name' => '返回列表', 'i' => '<i class="m-icon-swapleft"></i>'))) ?>
<div class="row">
    <div class="col-md-12">
        <div class="portlet box yellow">
            <div class="portlet-title">
                <div class="caption">
                    <i class="fa fa-coffee"></i><?= $obj->product_name ?>
                </div>
            </div>
            <div class="portlet-body">
                <div class="table-scrollable">
                    <table class="table table-bordered table-hover">
                        <tbody>
                        <tr>
                            <th width="4%">产品ID：</th>
                            <th width="6%"><?= $obj->id ?></th>

                            <th width="4%">产品名称：</th>
                            <th width="6%"><?= $obj->product_name ?></th>

                            <th width="4%">产品单价：</th>
                            <th width="6%"><?= $obj->price ?></th>
                            <th width="4%">采购人：</th>
                            <th width="6%"><?= $allPurchaser[$obj->purchaser_id] ?></th>

                            <th width="4%">产品单位：</th>
                            <th width="6%"><?= $obj->unit ?></th>
                            <th width="4%">产品类型：</th>
                            <th colspan="3" width="6%"><?= $obj->product_type ?></th>
                        </tr>
                        <tr>

                            <th width="4%">创建时间：</th>
                            <th colspan="2" width="6%"><?= date('Y-m-d H:i', $obj->create_time) ?></th>
                            <th width="4%">更新时间：</th>
                            <th colspan="2" width="6%"><?= date('Y-m-d H:i', $obj->update_time) ?></th>
                            <th width="4%">备注：</th>
                            <th colspan="5" width="6%"><?= $obj->remark ?></th>
                        </tr>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>

    <div class="col-md-12">
        <!-- BEGIN BORDERED TABLE PORTLET-->
        <div class="portlet box blue">
            <div class="portlet-title">
                <div class="caption"
                     style="display: flex;justify-content: space-between;width: 100%;align-items: center;">
                    <div>
                        <i class="fa fa-coffee"></i> 当前库存：<?= $quantity ?>
                    </div>
                    <form action="<?= site_url('storage/warehouse') ?>" method="post">
                        <input type="hidden" name="product_id" value="<?= $obj->id ?>">
                        <div>
                            <button type="submit" class="btn btn-warning">查看出入库信息</button>
                        </div>
                    </form>

                </div>
            </div>
            <div class="portlet-body">
                <div class="row">
                    <div class="col-xs-12">
                        <div class="table-scrollable">
                            <table class="table table-bordered table-hover">
                                <thead>
                                <tr>
                                    <th>入库批次</th>
                                    <th>所在仓库</th>
                                    <th>所在仓库区</th>
                                    <th>所属账户组</th>
                                    <th>入库数量</th>
                                    <th>剩余数量</th>
                                    <th>入库时间</th>
                                </tr>
                                </thead>
                                <tbody>
                                <?php foreach ($housings as $v): ?>
                                    <tr>
                                        <th class="text-center">
                                            <form action="<?= site_url('storage/warehouse') ?>" method="post">
                                                <input type="hidden" name="warehousing" value="<?= $v->warehousing ?>">
                                                <button class="btn purple" type="submit">
                                                    <?= $v->warehousing ?>
                                                </button>
                                            </form>
                                        </th>
                                        <th><?= IOSS_StaticConfig::getShippingWarehouse($v->location) ?></th>
                                        <th><?= IOSS_StaticConfig::getShippingBlock($v->area) ?></th>
                                        <th><?= $allShops[$v->shop_id] ?></th>
                                        <th><?= $v->origin_number ?></th>
                                        <th><span class="left-item"><?= $v->left_number ?></span></th>
                                        <th><?= date('Y-m-d H:i', $v->create_time) ?></th>
                                    </tr>
                                <?php endforeach; ?>
                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>
                <div class="row">
                    <div class="col-xs-12 text-right">
                        <?= $pagination ?>
                    </div>
                </div>
            </div>

        </div>
        <!-- END BORDERED TABLE PORTLET-->
    </div>
</div>